import scrapy
import json, requests

class ArticalSpiderSpider(scrapy.Spider):
    name = "artical_spider"
    allowed_domains = ["article.spbeen.com"]
    start_urls = ["http://article.spbeen.com/api/random_article/"]


    def parse(self, response):
        article = response.json()
        # print(article)
        for item in article:
            item = {}
            item['标题'] = list(article.values())[0]
            item['正文'] = list(article.values())[1]
            item['作者'] = list(article.values())[2]
            # print(item)
        yield item
